<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>C++ ABI (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="C++ ABI (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="C++ ABI (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Target-Macros.html" rel="up" title="Target Macros">
<link href="D-Language-and-ABI.html" rel="next" title="D Language and ABI">
<link href="PCH-Target.html" rel="prev" title="PCH Target">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
-->
</style>


</head>

<body lang="en">
<div class="section-level-extent" id="C_002b_002b-ABI">
<div class="nav-panel">
<p>
Next: <a href="D-Language-and-ABI.html" accesskey="n" rel="next">D ABI parameters</a>, Previous: <a href="PCH-Target.html" accesskey="p" rel="prev">Parameters for Precompiled Header Validity Checking</a>, Up: <a href="Target-Macros.html" accesskey="u" rel="up">Target Description Macros and Functions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="C_002b_002b-ABI-parameters"><span>18.28 C++ ABI parameters<a class="copiable-link" href="#C_002b_002b-ABI-parameters"> &para;</a></span></h3>
<a class="index-entry-id" id="index-parameters_002c-c_002b_002b-abi"></a>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fGUARD_005fTYPE"><span class="category-def">Target Hook: </span><span><code class="def-type">tree</code> <strong class="def-name">TARGET_CXX_GUARD_TYPE</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fGUARD_005fTYPE"> &para;</a></span></dt>
<dd><p>Define this hook to override the integer type used for guard variables.
These are used to implement one-time construction of static objects.  The
default is long_long_integer_type_node.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fGUARD_005fMASK_005fBIT"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_CXX_GUARD_MASK_BIT</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fGUARD_005fMASK_005fBIT"> &para;</a></span></dt>
<dd><p>This hook determines how guard variables are used.  It should return
<code class="code">false</code> (the default) if the first byte should be used.  A return value of
<code class="code">true</code> indicates that only the least significant bit should be used.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fGET_005fCOOKIE_005fSIZE"><span class="category-def">Target Hook: </span><span><code class="def-type">tree</code> <strong class="def-name">TARGET_CXX_GET_COOKIE_SIZE</strong> <code class="def-code-arguments">(tree <var class="var">type</var>)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fGET_005fCOOKIE_005fSIZE"> &para;</a></span></dt>
<dd><p>This hook returns the size of the cookie to use when allocating an array
whose elements have the indicated <var class="var">type</var>.  Assumes that it is already
known that a cookie is needed.  The default is
<code class="code">max(sizeof (size_t), alignof(type))</code>, as defined in section 2.7 of the
IA64/Generic C++ ABI.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fCOOKIE_005fHAS_005fSIZE"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_CXX_COOKIE_HAS_SIZE</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fCOOKIE_005fHAS_005fSIZE"> &para;</a></span></dt>
<dd><p>This hook should return <code class="code">true</code> if the element size should be stored in
array cookies.  The default is to return <code class="code">false</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fIMPORT_005fEXPORT_005fCLASS"><span class="category-def">Target Hook: </span><span><code class="def-type">int</code> <strong class="def-name">TARGET_CXX_IMPORT_EXPORT_CLASS</strong> <code class="def-code-arguments">(tree <var class="var">type</var>, int <var class="var">import_export</var>)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fIMPORT_005fEXPORT_005fCLASS"> &para;</a></span></dt>
<dd><p>If defined by a backend this hook allows the decision made to export
class <var class="var">type</var> to be overruled.  Upon entry <var class="var">import_export</var>
will contain 1 if the class is going to be exported, &minus;1 if it is going
to be imported and 0 otherwise.  This function should return the
modified value and perform any other actions necessary to support the
backend&rsquo;s targeted operating system.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fCDTOR_005fRETURNS_005fTHIS"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_CXX_CDTOR_RETURNS_THIS</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fCDTOR_005fRETURNS_005fTHIS"> &para;</a></span></dt>
<dd><p>This hook should return <code class="code">true</code> if constructors and destructors return
the address of the object created/destroyed.  The default is to return
<code class="code">false</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fKEY_005fMETHOD_005fMAY_005fBE_005fINLINE"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_CXX_KEY_METHOD_MAY_BE_INLINE</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fKEY_005fMETHOD_005fMAY_005fBE_005fINLINE"> &para;</a></span></dt>
<dd><p>This hook returns true if the key method for a class (i.e., the method
which, if defined in the current translation unit, causes the virtual
table to be emitted) may be an inline function.  Under the standard
Itanium C++ ABI the key method may be an inline function so long as
the function is not declared inline in the class definition.  Under
some variants of the ABI, an inline function can never be the key
method.  The default is to return <code class="code">true</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fDETERMINE_005fCLASS_005fDATA_005fVISIBILITY"><span class="category-def">Target Hook: </span><span><code class="def-type">void</code> <strong class="def-name">TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY</strong> <code class="def-code-arguments">(tree <var class="var">decl</var>)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fDETERMINE_005fCLASS_005fDATA_005fVISIBILITY"> &para;</a></span></dt>
<dd><p><var class="var">decl</var> is a virtual table, virtual table table, typeinfo object,
or other similar implicit class data object that will be emitted with
external linkage in this translation unit.  No ELF visibility has been
explicitly specified.  If the target needs to specify a visibility
other than that of the containing class, use this hook to set
<code class="code">DECL_VISIBILITY</code> and <code class="code">DECL_VISIBILITY_SPECIFIED</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fCLASS_005fDATA_005fALWAYS_005fCOMDAT"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fCLASS_005fDATA_005fALWAYS_005fCOMDAT"> &para;</a></span></dt>
<dd><p>This hook returns true (the default) if virtual tables and other
similar implicit class data objects are always COMDAT if they have
external linkage.  If this hook returns false, then class data for
classes whose virtual table will be emitted in only one translation
unit will not be COMDAT.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fLIBRARY_005fRTTI_005fCOMDAT"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_CXX_LIBRARY_RTTI_COMDAT</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fLIBRARY_005fRTTI_005fCOMDAT"> &para;</a></span></dt>
<dd><p>This hook returns true (the default) if the RTTI information for
the basic types which is defined in the C++ runtime should always
be COMDAT, false if it should not be COMDAT.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fUSE_005fAEABI_005fATEXIT"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_CXX_USE_AEABI_ATEXIT</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fUSE_005fAEABI_005fATEXIT"> &para;</a></span></dt>
<dd><p>This hook returns true if <code class="code">__aeabi_atexit</code> (as defined by the ARM EABI)
should be used to register static destructors when <samp class="option">-fuse-cxa-atexit</samp>
is in effect.  The default is to return false to use <code class="code">__cxa_atexit</code>.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fUSE_005fATEXIT_005fFOR_005fCXA_005fATEXIT"><span class="category-def">Target Hook: </span><span><code class="def-type">bool</code> <strong class="def-name">TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fUSE_005fATEXIT_005fFOR_005fCXA_005fATEXIT"> &para;</a></span></dt>
<dd><p>This hook returns true if the target <code class="code">atexit</code> function can be used
in the same manner as <code class="code">__cxa_atexit</code> to register C++ static
destructors. This requires that <code class="code">atexit</code>-registered functions in
shared libraries are run in the correct order when the libraries are
unloaded. The default is to return false.
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fADJUST_005fCLASS_005fAT_005fDEFINITION"><span class="category-def">Target Hook: </span><span><code class="def-type">void</code> <strong class="def-name">TARGET_CXX_ADJUST_CLASS_AT_DEFINITION</strong> <code class="def-code-arguments">(tree <var class="var">type</var>)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fADJUST_005fCLASS_005fAT_005fDEFINITION"> &para;</a></span></dt>
<dd><p><var class="var">type</var> is a C++ class (i.e., RECORD_TYPE or UNION_TYPE) that has just
been defined.  Use this hook to make adjustments to the class (eg, tweak
visibility or perform any other required target modifications).
</p></dd></dl>

<dl class="first-deftypefn">
<dt class="deftypefn" id="index-TARGET_005fCXX_005fDECL_005fMANGLING_005fCONTEXT"><span class="category-def">Target Hook: </span><span><code class="def-type">tree</code> <strong class="def-name">TARGET_CXX_DECL_MANGLING_CONTEXT</strong> <code class="def-code-arguments">(const_tree <var class="var">decl</var>)</code><a class="copiable-link" href="#index-TARGET_005fCXX_005fDECL_005fMANGLING_005fCONTEXT"> &para;</a></span></dt>
<dd><p>Return target-specific mangling context of <var class="var">decl</var> or <code class="code">NULL_TREE</code>.
</p></dd></dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="D-Language-and-ABI.html">D ABI parameters</a>, Previous: <a href="PCH-Target.html">Parameters for Precompiled Header Validity Checking</a>, Up: <a href="Target-Macros.html">Target Description Macros and Functions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
